import request from '@/utils/request'
import { PageData } from '@/types/resp.ts'
import { BlogComment, CommentPageParam, CommentStatusChangeParam, CommentGetParam } from '@/types'

export const page = (param: CommentPageParam): Promise<PageData<BlogComment>> => {
  return request({
    url: '/comment/page',
    method: 'post',
    data: param,
  })
}

export const statusChange = (param: CommentStatusChangeParam): Promise<unknown> => {
  return request({
    url: '/comment/status/change',
    method: 'post',
    data: param,
  })
}

export const getComment = (param: CommentGetParam): Promise<BlogComment> => {
  return request({
    url: '/comment/get',
    method: 'post',
    data: param,
  })
}

export const getCommentTree = (param: CommentGetParam): Promise<BlogComment> => {
  return request({
    url: '/comment/tree',
    method: 'post',
    data: param,
  })
}
